From 0f22d6bc8f4c9e4ddb6cd4ceebe35f43c6bc018e Mon Sep 17 00:00:00 2001 From: "robertlipe@gmail.com" Date: Fri, 3 Jan 2014 05:29:49 +0000 Subject: [PATCH] Fix default read of boolean opts with '1' as the default. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4708 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/gui/format.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gpsbabel/gui/format.h b/gpsbabel/gui/format.h index 8c1dead62..65d93e635 100644 --- a/gpsbabel/gui/format.h +++ b/gpsbabel/gui/format.h @@ -58,7 +58,13 @@ public: defaultValue_(defaultValue), minValue_(minValue), maxValue_(maxValue), html_(html) { value_ = QVariant(); - isSelected_ = false; + // Boolean values pay more atention to 'selected' than value. Make + // them match here. For non-bools, just make them unchecked. + if (type_ == OPTbool && defaultValue.toBool() == true) { + isSelected_ = true; + } else { + isSelected_ = false; + } } FormatOption(const FormatOption & c) -- 2.30.2